﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    
             xmlns:visualization="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:chartPrmtvs="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit">



    <Style x:Key="GraphSerie1Style" TargetType="Control">
        <Setter Property="Background" Value="{StaticResource GraphBGBrush1}"/>
        <Setter Property="BorderBrush" Value="{StaticResource GraphBorderBrush1}"/>
        <Setter Property="BorderThickness" Value="3"/>      
    </Style>

    <Style x:Key="GraphSerie1ColumnStyle" BasedOn="{StaticResource GraphSerie1Style}" TargetType="Control">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type charting:ColumnDataPoint}">
                    <Border
                        ToolTip="{Binding Hours}"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="GraphSerie2Style" TargetType="Control">
        <Setter Property="Background" Value="{StaticResource GraphBGBrush2}"/>
        <Setter Property="BorderBrush" Value="{StaticResource GraphBorderBrush2}"/>
        <Setter Property="BorderThickness" Value="3"/>
    </Style>

    <Style x:Key="GraphSerie2ColumnStyle" BasedOn="{StaticResource GraphSerie2Style}" TargetType="Control">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type charting:ColumnDataPoint}">
                    <Border
                        ToolTip="{Binding Hours}"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="HorizontalLegendStyle" TargetType="charting:LegendItem">
        <Setter Property="Margin" Value="0,0,10,0"/>     
    </Style>

    <Style x:Key="HideLegendStyle" TargetType="charting:LegendItem">
        <Setter Property="Visibility" Value="Collapsed"/>
    </Style>


    <Style TargetType="charting:Chart">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="charting:Chart">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        
                        <visualization:Title Content="{TemplateBinding Title}" Style="{TemplateBinding TitleStyle}" Margin="1"/>
                        
                        <chartPrmtvs:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}" Background="{TemplateBinding Background}">
                            <Grid Canvas.ZIndex="-1" Style="{TemplateBinding PlotAreaStyle}" Background="{TemplateBinding Background}"/>
                            <Border Canvas.ZIndex="10" BorderThickness="0"  />
                        </chartPrmtvs:EdgePanel>

                        <visualization:Legend x:Name="Legend" Grid.Row="1" Style="{TemplateBinding LegendStyle}" Title="{TemplateBinding LegendTitle}"/>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        
        <Setter Property="LegendStyle">
            <Setter.Value>
                <Style TargetType="visualization:Legend">
                    <Setter Property="BorderThickness"  Value="0,0,0,0"/>
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="FontSize" Value="{StaticResource SmallFontSize}"/>                   
                    <Setter Property="ItemsPanel">
                        <Setter.Value>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Horizontal" />                                      
                            </ItemsPanelTemplate>
                        </Setter.Value>
                    </Setter>                    
                </Style>
            </Setter.Value>            
        </Setter>        
    </Style>

</ResourceDictionary>